<?php
/*
	verifies that the user is authenticated
*/
session_start();
if ($_SESSION['autentifed']!="yes")
{ 
	header("Location:./index.php"); 
	exit(); 
}
else
{
	$date = $_SESSION['lastAccess']; 
	$hour = date("Y-n-j H:i:s"); 
	$time = (strtotime($hour)-strtotime($date));
	if($time >= 1200)
	{
		session_destroy(); 
		header("Location:./index.php"); 
	}
	else
	{ 
		$_SESSION['lastAccess'] = $hour; 
   	}
}
?>